﻿#region Libraries

using System;
using System.Web.Security;
using System.Web.UI;

#endregion

namespace XYZ_Inventory
{
    public partial class Site : MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string username = Page.User.Identity.Name;
            string role = RoleManager.GetRole(username).ToLower();

            aRawMaterials.Visible = role == "Materials Planner".ToLower() || role == "Inventory manager".ToLower() ||
                                    role == "Managing Director".ToLower();
            aProductRawMaterials.Visible = role == "Materials Planner".ToLower() ||
                                           role == "Managing Director".ToLower();
            aSupplier.Visible = role == "Purchasing Manager".ToLower() || role == "Managing Director".ToLower();
            aReport.Visible = role == "Purchasing Manager".ToLower() || role == "Managing Director".ToLower() ||
                              role == "Inventory manager".ToLower();
        }

        protected void ImageButton1_OnClick(object sender, ImageClickEventArgs e)
        {
            FormsAuthentication.SignOut();
            Response.Redirect("~/Default.aspx");
        }
    }
}